
Namespace persistent
    Public Class blackBerry_JOB
        Public Shared Function getBBCust() As DataTable
            Dim strSQL As String
            strSQL = " SELECT FN_MSISDN_TO_COID(MSISDN),MSISDN,BL.INTERNAL_ID FROM BB_COMPANY_CHARGE BC, BB_COMPANY_LINES BL "
            strSQL = strSQL + " WHERE(BC.INTERNAL_ID = BL.INTERNAL_ID) "
            strSQL = strSQL + " AND    BL.PROCESSED IS NULL"
            Return myDBConn.myORATable(strSQL)
        End Function
        Public Shared Function getSPcode(ByVal vsncode As String) As DataTable
            Dim strSQL As String
            strSQL = " SELECT SPCODE FROM MPULKTMB M1 WHERE TMCODE=39 AND CSIND IS NULL "
            strSQL = strSQL + " AND M1.VSCODE = (SELECT MAX(VSCODE) FROM MPULKTMB M2 WHERE M1.TMCODE=M2.TMCODE) "
            strSQL = strSQL + " AND SNCODE=" + vsncode
            Return myDBConn.myORATable(strSQL)
        End Function
        Public Shared Function setLineProcessed(ByVal internal_id As String, ByVal msisdn As String) As Integer
            Dim strSQL As String
            strSQL = " UPDATE(BB_COMPANY_LINES) "
            strSQL = strSQL + " SET PROCESSED='X', "
            strSQL = strSQL + " PROCESSED_DATE = SYSDATE "
            strSQL = strSQL + " WHERE INTERNAL_ID= " + internal_id
            strSQL = strSQL + " AND   MSISDN= " + msisdn
            Return myDBConn.ORAExecute(strSQL)
        End Function
        Public Shared Function setLogStatus(ByVal internal_id As Int64, ByVal msisdn As Int64, ByVal log_id As Int64) As Integer
            Dim strSQL As String
            strSQL = "INSERT INTO BB_LINES_LOG VALUES(INTERNAL_ID,MSISDN,LOG_ID,SYSDATE)"
            Return myDBConn.ORAExecute(strSQL)
        End Function

    End Class
End Namespace